<?php

session_start();

if (isset($_SESSION['error_msg'])) {
  if (! empty($_SESSION['error_msg']) ) {
    $error_msg = $_SESSION['error_msg'];
  }
}

if (isset($_SESSION['abstract_error_msg'])) {
  if (! empty($_SESSION['abstract_error_msg']) ) {
    $abstract_error_msg = $_SESSION['abstract_error_msg'];
  }
}

if (isset($_SESSION['symposium_error_msg'])) {
  if (! empty($_SESSION['symposium_error_msg']) ) {
    $symposium_error_msg = $_SESSION['symposium_error_msg'];
  }
}


if ( isset($_SESSION['username']) )          { $username          = $_SESSION['username']; }
if ( isset($_SESSION['affiliation']) )       { $affiliation       = $_SESSION['affiliation']; }
if ( isset($_SESSION['title']) )             { $title             = $_SESSION['title']; }
if ( isset($_SESSION['telephone']) )         { $telephone         = $_SESSION['telephone']; }
if ( isset($_SESSION['email']) )             { $email             = $_SESSION['email']; }
if ( isset($_SESSION['division']) )          { $division          = $_SESSION['division']; }
if ( isset($_SESSION['other_division']) )    { $other_division    = $_SESSION['other_division']; }
if ( isset($_SESSION['presentation_type']) ) { $presentation_type = $_SESSION['presentation_type']; }
if ( isset($_SESSION['equipment']) )         { $equipment         = $_SESSION['equipment']; }
if ( isset($_SESSION['other_equipment']) )   { $other_equipment   = $_SESSION['other_equipment']; }

if ( isset($_SESSION['is_page_valid']) )     { $is_page_valid     = $_SESSION['is_page_valid']; }

if ( isset($_SESSION['abstract_title']) )             { $abstract_title             = $_SESSION['abstract_title']; }
if ( isset($_SESSION['first_author_name']) )          { $first_author_name          = $_SESSION['first_author_name']; }
if ( isset($_SESSION['first_author_affiliation']) )   { $first_author_affiliation   = $_SESSION['first_author_affiliation']; }
if ( isset($_SESSION['second_author_name']) )         { $second_author_name         = $_SESSION['second_author_name']; }
if ( isset($_SESSION['second_author_affiliation']) )  { $second_author_affiliation  = $_SESSION['second_author_affiliation']; }
if ( isset($_SESSION['third_author_name']) )          { $third_author_name          = $_SESSION['third_author_name']; }
if ( isset($_SESSION['third_author_affiliation']) )   { $third_author_affiliation   = $_SESSION['third_author_affiliation']; }
if ( isset($_SESSION['fourth_author_name']) )         { $fourth_author_name         = $_SESSION['fourth_author_name']; }
if ( isset($_SESSION['fourth_author_affiliation']) )  { $fourth_author_affiliation  = $_SESSION['fourth_author_affiliation']; }
if ( isset($_SESSION['fifth_author_name']) )          { $fifth_author_name          = $_SESSION['fifth_author_name']; }
if ( isset($_SESSION['fifth_author_affiliation']) )   { $fifth_author_affiliation   = $_SESSION['fifth_author_affiliation']; }
if ( isset($_SESSION['sixth_author_name']) )          { $sixth_author_name          = $_SESSION['sixth_author_name']; }
if ( isset($_SESSION['sixth_author_affiliation']) )   { $sixth_author_affiliation   = $_SESSION['sixth_author_affiliation']; }
if ( isset($_SESSION['seventh_author_name']) )        { $seventh_author_name        = $_SESSION['seventh_author_name']; }
if ( isset($_SESSION['seventh_author_affiliation']) ) { $seventh_author_affiliation = $_SESSION['seventh_author_affiliation']; }
if ( isset($_SESSION['eighth_author_name']) )         { $eighth_author_name         = $_SESSION['eighth_author_name']; }
if ( isset($_SESSION['eighth_author_affiliation']) )  { $eighth_author_affiliation  = $_SESSION['eighth_author_affiliation']; }
if ( isset($_SESSION['ninth_author_name']) )          { $ninth_author_name          = $_SESSION['ninth_author_name']; }
if ( isset($_SESSION['ninth_author_affiliation']) )   { $ninth_author_affiliation   = $_SESSION['ninth_author_affiliation']; }
if ( isset($_SESSION['abstract']) )                   { $abstract                   = $_SESSION['abstract']; }
if ( isset($_SESSION['keywords']) )                   { $keywords                   = $_SESSION['keywords']; }

if ( isset($_SESSION['symposium_abstract_title']) )             { $symposium_abstract_title             = $_SESSION['symposium_abstract_title']; }
if ( isset($_SESSION['symposium_first_author_name']) )          { $symposium_first_author_name          = $_SESSION['symposium_first_author_name']; }
if ( isset($_SESSION['symposium_first_author_affiliation']) )   { $symposium_first_author_affiliation   = $_SESSION['symposium_first_author_affiliation']; }
if ( isset($_SESSION['symposium_second_author_name']) )         { $symposium_second_author_name         = $_SESSION['symposium_second_author_name']; }
if ( isset($_SESSION['symposium_second_author_affiliation']) )  { $symposium_second_author_affiliation  = $_SESSION['symposium_second_author_affiliation']; }
if ( isset($_SESSION['symposium_third_author_name']) )          { $symposium_third_author_name          = $_SESSION['symposium_third_author_name']; }
if ( isset($_SESSION['symposium_third_author_affiliation']) )   { $symposium_third_author_affiliation   = $_SESSION['symposium_third_author_affiliation']; }
if ( isset($_SESSION['symposium_fourth_author_name']) )         { $symposium_fourth_author_name         = $_SESSION['symposium_fourth_author_name']; }
if ( isset($_SESSION['symposium_fourth_author_affiliation']) )  { $symposium_fourth_author_affiliation  = $_SESSION['symposium_fourth_author_affiliation']; }
if ( isset($_SESSION['symposium_fifth_author_name']) )          { $symposium_fifth_author_name          = $_SESSION['symposium_fifth_author_name']; }
if ( isset($_SESSION['symposium_fifth_author_affiliation']) )   { $symposium_fifth_author_affiliation   = $_SESSION['symposium_fifth_author_affiliation']; }
if ( isset($_SESSION['symposium_sixth_author_name']) )          { $symposium_sixth_author_name          = $_SESSION['symposium_sixth_author_name']; }
if ( isset($_SESSION['symposium_sixth_author_affiliation']) )   { $symposium_sixth_author_affiliation   = $_SESSION['symposium_sixth_author_affiliation']; }
if ( isset($_SESSION['symposium_seventh_author_name']) )        { $symposium_seventh_author_name        = $_SESSION['symposium_seventh_author_name']; }
if ( isset($_SESSION['symposium_seventh_author_affiliation']) ) { $symposium_seventh_author_affiliation = $_SESSION['symposium_seventh_author_affiliation']; }
if ( isset($_SESSION['symposium_eighth_author_name']) )         { $symposium_eighth_author_name         = $_SESSION['symposium_eighth_author_name']; }
if ( isset($_SESSION['symposium_eighth_author_affiliation']) )  { $symposium_eighth_author_affiliation  = $_SESSION['symposium_eighth_author_affiliation']; }
if ( isset($_SESSION['symposium_ninth_author_name']) )          { $symposium_ninth_author_name          = $_SESSION['symposium_ninth_author_name']; }
if ( isset($_SESSION['symposium_ninth_author_affiliation']) )   { $symposium_ninth_author_affiliation   = $_SESSION['symposium_ninth_author_affiliation']; }
if ( isset($_SESSION['symposium_abstract']) )                   { $symposium_abstract                   = $_SESSION['symposium_abstract']; }
if ( isset($_SESSION['symposium_keywords']) )                   { $symposium_keywords                   = $_SESSION['symposium_keywords']; }

if ( isset($_SESSION['symposium_abstract_count']) )             { $symposium_abstract_count             = $_SESSION['symposium_abstract_count']; }


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="style.css" type="text/css" />
  <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  <script type="text/javascript" language="javascript">
    google.load("jquery", "1.3");
    google.load("jqueryui", "1.7");
  </script>
  <script>
    function strchlen(str) {
      var counter, i;
      counter = 0;
       for (i = 0; i < str.length; i++) {
        if (str.charCodeAt(i) > 255) {
          counter++;
        }
      }
      return counter;
    }

    function strenlen(str) {
      var counter, i;
      counter = 0;
      for (i = 0; i < str.length; i++) {
        while (str.charAt(i) == ' ' || str.charCodeAt(i) > 255 || str.charAt(i) == '\n') i++;
        if (str.charAt(i + 1) == ' ' || str.charAt(i + 1) == '\n' || str.charCodeAt( i + 1) > 255 || i == str.length - 1) counter++;
      }
      return counter;
    }

    $(document).ready(function() {

      $(":input[name='abstract']").keypress(
        function() {
          $(":submit[name='submit_abstract']").attr("disabled", "disabled");
      });
      $(":input[name='abstract']").click(
        function() {
          $(":submit[name='submit_abstract']").attr("disabled", "disabled");
      });
      $(":input[name='symposium_abstract']").keypress(
        function() {
          $(":submit[name='next_abstract']").attr("disabled", "disabled");
          $(":submit[name='submit_total_abstract']").attr("disabled", "disabled");
      });
      $(":input[name='symposium_abstract']").click(
        function() {
          $(":submit[name='next_abstract']").attr("disabled", "disabled");
          $(":submit[name='submit_total_abstract']").attr("disabled", "disabled");
      });

      $(":input[name='word_count_button']").click(
        function() {
          var str = $("#abstract").val();
          str = str.replace( /<.[^<>]*?>/g, ' ').replace( /&nbsp;/gi, ' ');
          str = str.replace( /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g, '');
          var str_count = 0;
          var chinese_str_count = 0;
          var english_str_count = 0;
          chinese_str_count = strchlen(str);
          english_str_count = strenlen(str);
          str_count = chinese_str_count + english_str_count;
          $("#chineseTextCount").text(chinese_str_count);
          $("#englishTextCount").text(english_str_count);
          $("#txtCount").text(str_count);
          if (str_count > 300 && chinese_str_count == 0) {
            $(":submit[name='submit_abstract']").attr("disabled", "disabled");
          }
          if (str_count > 500 && chinese_str_count != 0) {
            $(":submit[name='submit_abstract']").attr("disabled", "disabled");
          }
          if (str_count <= 300 && chinese_str_count == 0) {
            $(":submit[name='submit_abstract']").removeAttr("disabled");
          }
          if (str_count <= 500 && chinese_str_count != 0) {
            $(":submit[name='submit_abstract']").removeAttr("disabled");
          }
          return false;
      });

      $(":input[name='symposium_word_count_button']").click(
        function() {
          var str = $("#symposium_abstract").val();
          str = str.replace( /<.[^<>]*?>/g, ' ').replace( /&nbsp;/gi, ' ');
          str = str.replace( /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g, '');
          var str_count = 0;
          var chinese_str_count = 0;
          var english_str_count = 0;
          chinese_str_count = strchlen(str);
          english_str_count = strenlen(str);
          str_count = chinese_str_count + english_str_count;
          $("#chineseTextCount").text(chinese_str_count);
          $("#englishTextCount").text(english_str_count);
          $("#txtCount").text(str_count);
          if (str_count > 300 && chinese_str_count == 0) {
            $(":submit[name='next_abstract']").attr("disabled", "disabled");
            $(":submit[name='submit_total_abstract']").attr("disabled", "disabled");
          }
          if (str_count > 500 && chinese_str_count != 0) {
            $(":submit[name='next_abstract']").attr("disabled", "disabled");
            $(":submit[name='submit_total_abstract']").attr("disabled", "disabled");
          }
          if (str_count <= 300 && chinese_str_count == 0) {
            $(":submit[name='next_abstract']").removeAttr("disabled");
            $(":submit[name='submit_total_abstract']").removeAttr("disabled");
          }
          if (str_count <= 500 && chinese_str_count != 0) {
            $(":submit[name='next_abstract']").removeAttr("disabled");
            $(":submit[name='submit_total_abstract']").removeAttr("disabled");
          }
          return false;
      });

      $("input:button[name='more_authors_button']").toggle(
        function() {
          $("#more_authors").show();
          var text = "按此增加作者欄位";
          $("input:button[name='more_authors_button']").val(text);
        },
        function() {
          $("#more_authors").hide();
			    var text = "按此減少作者欄位";
			    $("input:button[name='more_authors_button']").val(text);
      	}
      );

			$("input:button[name='more_symposium_authors_button']").toggle(
			  function() {
			    $("#more_symposium_authors").show();
			    var text = "按此減少作者欄位";
			    $("input:button[name='more_symposium_authors_button']").val(text);
        },
      	function() {
          $("#more_symposium_authors").hide();
			    var text = "按此增少作者欄位";
			    $("input:button[name='more_symposium_authors_button']").val(text);
      	}
      );
    });
  </script>
  <title>第四十八屆台灣心理學年會投稿系統</title>
</head>

<body>
  <div id="container">
    <div id="header">
      <h1>我要<span class="h1_span">投稿</span></h1>
    </div>

    <?php if (isset($error_msg)) { echo "<p class=\"error\">" . $error_msg . "</p>"; } ?>

    <div id="submission_form">
      <form action="do_submit.php" method="post">
      <fieldset>
      <legend>個人資訊</legend>
      <p>
        <label>姓名：（必填）</label><br />
        <?php
          if (isset($username)) {
            if (strcmp($username, "") != 0) {
              if ($is_page_valid) {
                echo "<input type=\"text\" name=\"username\" value=\"" . $username . "\" readonly=\"readonly\" />\n";
              }
              else {
                echo "<input type=\"text\" name=\"username\" value=\"" . $username . "\" />\n";
              }
            }
            else {
              echo "<input type=\"text\" name=\"username\" />\n";
            }
          }
          else {
            echo "<input type=\"text\" name=\"username\" />\n";
          }
        ?>
      </p>
      <p>
        <label>單位：（必填）</label><br />
        <?php
          if (isset($affiliation)) {
            if (strcmp($affiliation, "") != 0) {
              if ($is_page_valid) {
                echo "<input type=\"text\" name=\"affiliation\" value=\"" . $affiliation . "\" readonly=\"readonly\" />\n";
              }
              else {
                echo "<input type=\"text\" name=\"affiliation\" value=\"" . $affiliation . "\" />\n";
              }
            }
            else {
              echo "<input type=\"text\" name=\"affiliation\" />\n";
            }
          }
          else {
            echo "<input type=\"text\" name=\"affiliation\" />\n";
          }
        ?>
      </p>
      <p>
        <label>職稱：</label><br />
        <?php
          if (isset($title)) {
            if (strcmp($title, "") != 0) {
              if ($is_page_valid) {
                echo "<input type=\"text\" name=\"title\" value=\"" . $title . "\" readonly=\"readonly\" />\n";
              }
              else {
                echo "<input type=\"text\" name=\"title\" value=\"" . $title . "\" />\n";
              }
            }
            else {
              if ($is_page_valid) {
                echo "<input type=\"text\" name=\"title\" readonly=\"readonly\" />\n";
              }
              else {
                echo "<input type=\"text\" name=\"title\" />\n";
              }
            }
          }
          else {
            echo "<input type=\"text\" name=\"title\" />\n";
          }
        ?>
      </p>
      <p>
        <label>聯絡電話：</label><br />
        <?php
          if (isset($telephone)) {
            if (strcmp($telephone, "") != 0) {
              if ($is_page_valid) {
                echo "<input type=\"text\" name=\"telephone\" value=\"" . $telephone . "\" readonly=\"readonly\" /> 09XXXXXXXX 或 0X-XXXXXXX\n";
              }
              else {
                echo "<input type=\"text\" name=\"telephone\" value=\"" . $telephone . "\" /> 09XXXXXXXX 或 0X-XXXXXXX\n";
              }
            }
            else {
              if ($is_page_valid) {
                echo "<input type=\"text\" name=\"telephone\" readonly=\"readonly\" /> 09XXXXXXXX 或 0X-XXXXXXX\n";
              }
              else {
                echo "<input type=\"text\" name=\"telephone\" /> 09XXXXXXXX 或 0X-XXXXXXX\n";
              }
            }
          }
          else {
            echo "<input type=\"text\" name=\"telephone\" /> 09XXXXXXXX 或 0X-XXXXXXX\n";
          }
        ?>
      </p>
      <p>
        <label>電子郵件：（必填）</label><br />
        <?php
          if (isset($email)) {
            if (strcmp($email, "") != 0) {
              if ($is_page_valid) {
                echo "<input type=\"text\" name=\"email\" value=\"" . $email . "\" readonly=\"readonly\" />\n";
              }
              else {
                echo "<input type=\"text\" name=\"email\" value=\"" . $email . "\" />\n";
              }
            }
            else {
              echo "<input type=\"text\" name=\"email\" />\n";
            }
          }
          else {
            echo "<input type=\"text\" name=\"email\" />\n";
          }
        ?>
      </p>
      <p>
        <label>參加組別：（必填）</label><br />
        <?php
          if (isset($division)) {
            if ($is_page_valid) {
              if (strcmp($division, 'cognitive') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"cognitive\" checked=\"checked\" disabled=\"disabled\" />認知\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"cognitive\" disabled=\"disabled\" />認知\n";
              }
              if (strcmp($division, 'educational') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"educational\" checked=\"checked\" disabled=\"disabled\" />教心\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"educational\" disabled=\"disabled\" />教心\n";
              }
              if (strcmp($division, 'io') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"io\" checked=\"checked\" disabled=\"disabled\" />工商\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"io\" disabled=\"disabled\" />工商\n";
              }
              if (strcmp($division, 'social') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"social\" checked=\"checked\" disabled=\"disabled\" />社心人格\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"social\" disabled=\"disabled\" />社心人格\n";
              }
              if (strcmp($division, 'clinical') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"clinical\" checked=\"checked\" disabled=\"disabled\" />臨床諮商\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"clinical\" disabled=\"disabled\" />臨床諮商\n";
              }
              if (strcmp($division, 'psychometric') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"psychometric\" checked=\"checked\" disabled=\"disabled\" />計量\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"psychometric\" disabled=\"disabled\" />計量\n";
              }
              if (strcmp($division, 'developmental') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"developmental\" checked=\"checked\" disabled=\"disabled\" />發展\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"developmental\" disabled=\"disabled\" />發展\n";
              }
              if (strcmp($division, 'biological') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"biological\" checked=\"checked\" disabled=\"disabled\" />生心\n<br />";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"biological\" disabled=\"disabled\" />生心\n<br />";
              }
              if (strcmp($division, 'other') == 0) {
                  echo "<input type=\"radio\" name=\"division\" value=\"other\" checked=\"checked\" disabled=\"disabled\" />其他\n";
                  if (isset($other_division)) {
                    echo "<input type=\"text\" name=\"other_division\" value=\"" . $other_division . "\" readonly=\"readonly\" />（請註明組別）";
                  }
              }
              else {
                echo "<input type=\"radio\" name=\"division\" value=\"other\" disabled=\"disabled\" />其他\n
                      <input type=\"text\" name=\"other_division\" readonly=\"readonly\" />（請註明組別）\n";
              }
            }
            else {
            if (strcmp($division, 'cognitive') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"cognitive\" checked=\"checked\" />認知\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"cognitive\" />認知\n";
              }
              if (strcmp($division, 'educational') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"educational\" checked=\"checked\" />教心\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"educational\" />教心\n";
              }
              if (strcmp($division, 'io') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"io\" checked=\"checked\" />工商\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"io\" />工商\n";
              }
              if (strcmp($division, 'social') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"social\" checked=\"checked\" />社心人格\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"social\" />社心人格\n";
              }
              if (strcmp($division, 'clinical') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"clinical\" checked=\"checked\" />臨床諮商\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"clinical\" />臨床諮商\n";
              }
              if (strcmp($division, 'psychometric') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"psychometric\" checked=\"checked\" />計量\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"psychometric\" />計量\n";
              }
              if (strcmp($division, 'developmental') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"developmental\" checked=\"checked\" />發展\n";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"developmental\" />發展\n";
              }
              if (strcmp($division, 'biological') == 0) {
                echo "<input type=\"radio\" name=\"division\" value=\"biological\" checked=\"checked\" />生心\n<br />";
              } else {
                echo "<input type=\"radio\" name=\"division\" value=\"biological\" />生心\n<br />";
              }
              if (strcmp($division, 'other') == 0) {
                  echo "<input type=\"radio\" name=\"division\" value=\"other\" checked=\"checked\" />其他\n";
                  if (isset($other_division)) {
                    echo "<input type=\"text\" name=\"other_division\" value=\"" . $other_division . "\" />（請註明組別）";
                  }
                  else {
                    echo "<input type=\"text\" name=\"other_division\" />（請註明組別）\n";
                  }
              }
              else {
                echo "<input type=\"radio\" name=\"division\" value=\"other\" />其他\n
                      <input type=\"text\" name=\"other_division\" />（請註明組別）\n";
              }
            }
          }
          else {
            echo "<input type=\"radio\" name=\"division\" value=\"cognitive\" />認知\n
                  <input type=\"radio\" name=\"division\" value=\"educational\" />教心\n
                  <input type=\"radio\" name=\"division\" value=\"io\" />工商\n
                  <input type=\"radio\" name=\"division\" value=\"social\" />社心人格\n
                  <input type=\"radio\" name=\"division\" value=\"clinical\" />臨床諮商\n
                  <input type=\"radio\" name=\"division\" value=\"psychometric\" />計量\n
                  <input type=\"radio\" name=\"division\" value=\"developmental\" />發展\n
                  <input type=\"radio\" name=\"division\" value=\"biological\" />生心\n<br />
                  <input type=\"radio\" name=\"division\" value=\"other\" />其他\n
                  <input type=\"text\" name=\"other_division\" />（請註明組別）\n";
          }
        ?>
      </p>
      </fieldset>
   		  
      <br />

      <fieldset>
      <legend>投稿資訊</legend>
      <p>
        <label>投稿類別：（必填）</label>
        <?php
          if (isset($presentation_type)) {
            if ($is_page_valid) {
              if (strcmp($presentation_type, 'symposium') == 0) {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"symposium\" checked=\"checked\" disabled=\"disabled\" />專題座談\n";
              } else {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"symposium\" disabled=\"disabled\" />專題座談\n";
              }
              if (strcmp($presentation_type, 'oral') == 0) {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"oral\" checked=\"checked\" disabled=\"disabled\" />口頭報告\n";
              } else {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"oral\" disabled=\"disabled\" />口頭報告\n";
              }
              if (strcmp($presentation_type, 'poster') == 0) {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"poster\" checked=\"checked\" disabled=\"disabled\" />壁報\n";
              } else {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"poster\" disabled=\"disabled\" />壁報\n";
              }
            }
            else {
              if (strcmp($presentation_type, 'symposium') == 0) {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"symposium\" checked=\"checked\" />專題座談\n";
              } else {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"symposium\" />專題座談\n";
              }
              if (strcmp($presentation_type, 'oral') == 0) {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"oral\" checked=\"checked\" />口頭報告\n";
              } else {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"oral\" />口頭報告\n";
              }
              if (strcmp($presentation_type, 'poster') == 0) {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"poster\" checked=\"checked\" />壁報\n";
              } else {
                echo "<input type=\"radio\" name=\"presentation_type\" value=\"poster\" />壁報\n";
              }              
            }
          }
          else {
            echo "<input type=\"radio\" name=\"presentation_type\" value=\"symposium\" />專題座談
                  <input type=\"radio\" name=\"presentation_type\" value=\"oral\" />口頭報告
                  <input type=\"radio\" name=\"presentation_type\" value=\"poster\" />壁報";
          }
        ?>
      </p>
      <p>
        <label>所需器材：</label>
        <?php
          if (!is_null($equipment)) {
            if ($is_page_valid) {
              if (count($equipment) == 2) {
                echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" checked=\"checked\" disabled=\"disabled\" />簡報筆\n
                      <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" checked=\"checked\" disabled=\"disabled\" />其他
                      <input type=\"text\" name=\"other_equipment\" value=\"" . $other_equipment . "\"  readonly=\"readonly\" />（請註明器材）";
              }
              if (count($equipment) == 1) {
                if (strcmp($equipment[0], "laser_pen") == 0) {
                  echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" checked=\"checked\" disabled=\"disabled\" />簡報筆\n
                        <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" disabled=\"disabled\" />其他
                        <input type=\"text\" name=\"other_equipment\" readonly=\"readonly\" />（請註明器材）";
                }
                if (strcmp($equipment[0], "other") == 0) {
                  echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" disabled=\"disabled\" /> 簡報筆\n
                        <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" checked=\"checked\" disabled=\"disabled\" />其他
                        <input type=\"text\" name=\"other_equipment\" value=\"" . $other_equipment . "\" readonly=\"readonly\" />（請註明器材）";
                }
                if (strcmp($equipment[0], "laser_pen") != 0 && strcmp($equipment[0], "other") != 0) {
                  echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" disabled=\"disabled\" />簡報筆
                        <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" disabled=\"disabled\" />其他
                        <input type=\"text\" name=\"other_equipment\" readonly=\"readonly\" />（請註明器材）";
                }
              }
            }
            else {
              if (count($equipment) == 2) {
                echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" checked=\"checked\" />簡報筆\n
                      <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" checked=\"checked\" />其他";
                if (isset($other_equipment)) {
                  echo "<input type=\"text\" name=\"other_equipment\" value=\"" . $other_equipment . "\" />（請註明器材）";
                } else {
                  echo "<input type=\"text\" name=\"other_equipment\" />（請註明器材）\n";
                }
              }
              if (count($equipment) == 1) {
                if (strcmp($equipment[0], "laser_pen") == 0) {
                  echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" checked=\"checked\" />簡報筆\n
                        <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" />其他
                        <input type=\"text\" name=\"other_equipment\" />（請註明器材）";
                }
                if (strcmp($equipment[0], "other") == 0) {
                  echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" /> 簡報筆\n
                        <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" checked=\"checked\" />其他";
                  if (isset($other_equipment)) {
                    echo "<input type=\"text\" name=\"other_equipment\" value=\"" . $other_equipment . "\" />（請註明器材）";
                  } else {
                    echo "<input type=\"text\" name=\"other_equipment\" />（請註明器材）\n";
                  }
                }
                if (strcmp($equipment[0], "laser_pen") != 0 && strcmp($equipment[0], "other") != 0) {
                  echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" />簡報筆
                        <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" />其他
                        <input type=\"text\" name=\"other_equipment\" />（請註明器材）";
                }
              }              
            }
          }
          else {
            if ($is_page_valid) {
              echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" disabled=\"disabled\" />簡報筆
                    <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" disabled=\"disabled\" />其他
                    <input type=\"text\" name=\"other_equipment\" readonly=\"readonly\" />（請註明器材）";
            }
            else {
              echo "<input type=\"checkbox\" name=\"equipment[]\" value=\"laser_pen\" />簡報筆
                    <input type=\"checkbox\" name=\"equipment[]\" value=\"other\" />其他
                    <input type=\"text\" name=\"other_equipment\" />（請註明器材）";
            }
          }
        ?>

        <br />
        <br />
        <?php
          if (strcmp($presentation_type, '') != 0) {
            if ($is_page_valid) {
              echo "<input type=\"submit\" name=\"confirm_presentation_type\" value=\"確認\" disabled=\"disabled\" />";
            }
            else {
              echo "<input type=\"submit\" name=\"confirm_presentation_type\" value=\"確認\" />\n";
            }
          }
          else {
            echo "<input type=\"submit\" name=\"confirm_presentation_type\" value=\"確認\" />\n";
          }
        ?>
      </p>
      </fieldset>

      <br />
      <?php
        if ($is_page_valid) {
          if (strcmp($presentation_type, "symposium") != 0) {
            echo "<fieldset id=\"not_symposium\">
                  <legend>論文資訊</legend>";

            if (isset($abstract_error_msg)) { echo "<p class=\"error\">" . $abstract_error_msg . "</p>"; }

            echo "<p>
                  <label>題目：（必填）</label>";

            if (strcmp($abstract_title, '') != 0) {
              echo "<input type=\"text\" name=\"abstract_title\" value=\"" . $abstract_title . "\" size=\"75\" />";
            }
            else {
              echo "<input type=\"text\" name=\"abstract_title\" size=\"75\" />";
            }

            echo "</p>
                  <br />
                  <p>
                  <label>第一作者：（必填）</label>";

            if (strcmp($first_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"first_author_name\" value=\"" . $first_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"first_author_name\" />";
            }

            echo "<label> 所屬單位：（必填）</label>";

            if (strcmp($first_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"first_author_affiliation\" value=\"" . $first_author_affiliation . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"first_author_affiliation\" />";
            }

            echo "</p>
                  <p>
                  <label>第二作者：</label>";

            if (strcmp($second_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"second_author_name\" value=\"" . $second_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"second_author_name\" />";
            }

            echo "<label> 所屬單位：</label>";

            if (strcmp($second_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"second_author_affiliation\" value=\"" . $second_author_affiliation . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"second_author_affiliation\" />";
            }

            echo "</p>
                  <p>
                  <label>第三作者：</label>";

            if (strcmp($third_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"third_author_name\" value=\"" . $third_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"third_author_name\" />";
            }

            echo "<label> 所屬單位：</label>";

            if (strcmp($third_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"third_author_affiliation\" value=\"" . $third_author_affiliation . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"third_author_affiliation\" />";
            }

            echo "</p>
                  <br />";

            if ((strcmp($fourth_author_name, '') == 0)         &&
                (strcmp($fourth_author_affiliation, '') == 0)  &&
                (strcmp($fifth_author_name, '') == 0)          &&
                (strcmp($fifth_author_affiliation, '') == 0)   &&
                (strcmp($sixth_author_name, '') == 0)          &&
                (strcmp($sixth_author_affiliation, '') == 0)   &&
                (strcmp($seventh_author_name, '') == 0)        &&
                (strcmp($seventh_author_affiliation, '') == 0) &&
                (strcmp($eighth_author_name, '') == 0)         &&
                (strcmp($eighth_author_affiliation, '') == 0)  &&
                (strcmp($ninth_author_name, '') == 0)          &&
                (strcmp($ninth_author_affiliation, '') == 0)) {
              echo "<input type=\"button\" name=\"more_authors_button\" value=\"按此增加作者欄位\" />";
              echo "<div id=\"more_authors\" style=\"display: none;\" />";
            }
            else {
              echo "<div id=\"more_authors\" />";
            }

            echo "  <br />
                    <br />
                    <label>第四作者：</label>";

            if (strcmp($fourth_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"fourth_author_name\" value=\"" . $fourth_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"fourth_author_name\" />";
            }

            echo "<label> 所屬單位：</label>";

            if (strcmp($fourth_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"fourth_author_affiliation\" value=\"" . $fourth_author_affiliation . "\" />\n<br />";
            }
            else {
              echo "<input type=\"text\" name=\"fourth_author_affiliation\" /><br />";
            }
            
            echo "<label>第五作者：</label>";

            if (strcmp($fifth_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"fifth_author_name\" value=\"" . $fifth_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"fifth_author_name\" />";
            }

            echo "<label> 所屬單位：</label>";
            
            if (strcmp($fifth_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"fifth_author_affiliation\" value=\"" . $fifth_author_affiliation . "\" />\n<br />";
            }
            else {
              echo "<input type=\"text\" name=\"fifth_author_affiliation\" /><br />";
            }

            echo "<label>第六作者：</label>";

            if (strcmp($sixth_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"sixth_author_name\" value=\"" . $sixth_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"sixth_author_name\" />";
            }

            echo "<label> 所屬單位：</label>";

            if (strcmp($sixth_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"sixth_author_affiliation\" value=\"" . $sixth_author_affiliation . "\" />\n<br />";
            }
            else {
              echo "<input type=\"text\" name=\"sixth_author_affiliation\" /><br />";
            }
            
            echo "<label>第七作者：</label>";

            if (strcmp($seventh_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"seventh_author_name\" value=\"" . $seventh_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"seventh_author_name\" />";
            }

            echo "<label> 所屬單位：</label>";
            
            if (strcmp($seventh_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"seventh_author_affiliation\" value=\"" . $seventh_author_affiliation . "\" />\n<br />";
            }
            else {
              echo "<input type=\"text\" name=\"seventh_author_affiliation\" /><br />";
            }

            echo "<label>第八作者：</label>";

            if (strcmp($eighth_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"eighth_author_name\" value=\"" . $eighth_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"eighth_author_name\" />";
            }

            echo "<label> 所屬單位：</label>";

            if (strcmp($eighth_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"eighth_author_affiliation\" value=\"" . $eighth_author_affiliation . "\" />\n<br />";
            }
            else {
              echo "<input type=\"text\" name=\"eighth_author_affiliation\" /><br />";
            }

            echo "<label>第九作者：</label>";

            if (strcmp($ninth_author_name, '') != 0) {
              echo "<input type=\"text\" name=\"ninth_author_name\" value=\"" . $ninth_author_name . "\" />";
            }
            else {
              echo "<input type=\"text\" name=\"ninth_author_name\" />";
            }

            echo "<label> 所屬單位：</label>";

            if (strcmp($ninth_author_affiliation, '') != 0) {
              echo "<input type=\"text\" name=\"ninth_author_affiliation\" value=\"" . $ninth_author_affiliation . "\" />\n<br />";
            }
            else {
              echo "<input type=\"text\" name=\"ninth_author_affiliation\" /><br />";
            }

            echo "</div>
                  <br />
                  <p>
                  <br /><br />
                  <label>投稿摘要：（必填）</label>
                  <p>全部共 <span id=\"txtCount\">0</span> 字，中文 <span id=\"chineseTextCount\">0</span> 字，英文 <span id=\"englishTextCount\">0</span> 字</p>";

            if (strcmp($abstract, '') != 0) {
              echo "<textarea name=\"abstract\" id=\"abstract\" rows=\"30\" cols=\"65\">" . $abstract . "</textarea>";
            }
            else {
              echo "<textarea name=\"abstract\" id=\"abstract\" rows=\"30\" cols=\"65\"></textarea>";
            }

            echo "</p>
                  <p>
                  <label>關鍵字：（必填）</label>";

            if (strcmp($keywords, '') != 0) {
              echo "<input type=\"text\" name=\"keywords\" value=\"" . $keywords . "\" size=\"75\" />";
            }
            else {
              echo "<input type=\"text\" name=\"keywords\" size=\"75\" />";
            }
            echo "<button name=\"word_count_button\" id=\"word_count_button\" style=\"margin-left: 10px;\">計算字數</button>";
            echo "</p>
                  </fieldset>
                  <br />
                  <p>
                  <input type=\"submit\" name=\"submit_abstract\" value=\"送出\" disabled=\"disabled\" />
                  <hr />
                  <p>
                  * 提醒您：投稿完成後，若您計畫前來參加研討會，仍需至報名系統完成報名手續，請詳實填寫各項參加資訊以供本大會提供相關服務。謝謝！
                  </p>";
        }
        else {
          echo "<fieldset id=\"symposium\">";
          if (isset($symposium_abstract_count)) {
            echo "<legend>請輸入第 " . ($symposium_abstract_count+2) . " 篇論文資訊</legend>";
          }
          else {
            echo "<legend>請輸入第 1 篇論文資訊</legend>";
          }
          echo "<p>";

          if (isset($symposium_error_msg)) { echo "<p class=\"error\">" . $symposium_error_msg . "</p>"; }

          echo "<p>
                <label>題目：（必填）</label>";

          if (strcmp($symposium_abstract_title, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_abstract_title\" value=\"" . $symposium_abstract_title . "\" size=\"75\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_abstract_title\" size=\"75\" />";
          }

          echo "</p>
                <br />
                <p>
                <label>第一作者：（必填）</label>";

          if (strcmp($symposium_first_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_first_author_name\" value=\"" . $symposium_first_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_first_author_name\" />";
          }

          echo "<label> 所屬單位：（必填）</label>";

          if (strcmp($symposium_first_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_first_author_affiliation\" value=\"" . $symposium_first_author_affiliation . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_first_author_affiliation\" />";
          }

          echo "</p>
                <p>
                <label>第二作者：</label>";

          if (strcmp($symposium_second_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_second_author_name\" value=\"" . $symposium_second_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_second_author_name\" />";
          }

          echo "<label> 所屬單位：</label>";

          if (strcmp($symposium_second_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_second_author_affiliation\" value=\"" . $symposium_second_author_affiliation . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_second_author_affiliation\" />";
          }

          echo "</p>
                <p>
                <label>第三作者：</label>";

          if (strcmp($symposium_third_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_third_author_name\" value=\"" . $symposium_third_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_third_author_name\" />";
          }

          echo "<label> 所屬單位：</label>";

          if (strcmp($symposium_third_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_third_author_affiliation\" value=\"" . $symposium_third_author_affiliation . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_third_author_affiliation\" />";
          }

          echo "</p>
                <br />";

          if ((strcmp($symposium_fourth_author_name, '') == 0)         &&
              (strcmp($symposium_fourth_author_affiliation, '') == 0)  &&
              (strcmp($symposium_fifth_author_name, '') == 0)          &&
              (strcmp($symposium_symposium_fifth_author_affiliation, '') == 0)   &&
              (strcmp($symposium_sixth_author_name, '') == 0)          &&
              (strcmp($symposium_sixth_author_affiliation, '') == 0)   &&
              (strcmp($symposium_seventh_author_name, '') == 0)        &&
              (strcmp($symposium_seventh_author_affiliation, '') == 0) &&
              (strcmp($symposium_eighth_author_name, '') == 0)         &&
              (strcmp($symposium_eighth_author_affiliation, '') == 0)  &&
              (strcmp($symposium_ninth_author_name, '') == 0)          &&
              (strcmp($symposium_ninth_author_affiliation, '') == 0)) {
            echo "<input type=\"button\" name=\"more_symposium_authors_button\" value=\"按此增加作者欄位\" />";
            echo "<div id=\"more_symposium_authors\" style=\"display: none;\" />";
          }
          else {
            echo "<div id=\"more_symposium_authors\" />";
          }

          echo "  <br />
                  <br />
                  <label>第四作者：</label>";

          if (strcmp($symposium_fourth_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_fourth_author_name\" value=\"" . $symposium_fourth_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_fourth_author_name\" />";
          }

          echo "<label> 所屬單位：</label>";

          if (strcmp($symposium_fourth_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_fourth_author_affiliation\" value=\"" . $symposium_fourth_author_affiliation . "\" />\n<br />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_fourth_author_affiliation\" /><br />";
          }

          echo "<label>第五作者：</label>";

          if (strcmp($symposium_fifth_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_fifth_author_name\" value=\"" . $symposium_fifth_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_fifth_author_name\" />";
          }

          echo "<label> 所屬單位：</label>";

          if (strcmp($symposium_fifth_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_fifth_author_affiliation\" value=\"" . $symposium_fifth_author_affiliation . "\" />\n<br />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_fifth_author_affiliation\" /><br />";
          }

          echo "<label>第六作者：</label>";

          if (strcmp($symposium_sixth_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_sixth_author_name\" value=\"" . $symposium_sixth_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_sixth_author_name\" />";
          }

          echo "<label> 所屬單位：</label>";

          if (strcmp($symposium_sixth_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_sixth_author_affiliation\" value=\"" . $symposium_sixth_author_affiliation . "\" />\n<br />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_sixth_author_affiliation\" /><br />";
          }

          echo "<label>第七作者：</label>";

          if (strcmp($symposium_seventh_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_seventh_author_name\" value=\"" . $symposium_seventh_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_seventh_author_name\" />";
          }

          echo "<label> 所屬單位：</label>";

          if (strcmp($symposium_seventh_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_seventh_author_affiliation\" value=\"" . $symposium_seventh_author_affiliation . "\" />\n<br />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_seventh_author_affiliation\" /><br />";
          }

          echo "<label>第八作者：</label>";

          if (strcmp($symposium_eighth_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_eighth_author_name\" value=\"" . $symposium_eighth_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_eighth_author_name\" />";
          }

          echo "<label> 所屬單位：</label>";

          if (strcmp($symposium_eighth_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_eighth_author_affiliation\" value=\"" . $symposium_eighth_author_affiliation . "\" />\n<br />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_eighth_author_affiliation\" /><br />";
          }

          echo "<label>第九作者：</label>";

          if (strcmp($symposium_ninth_author_name, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_ninth_author_name\" value=\"" . $symposium_ninth_author_name . "\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_ninth_author_name\" />";
          }

          echo "<label> 所屬單位：</label>";

          if (strcmp($symposium_ninth_author_affiliation, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_ninth_author_affiliation\" value=\"" . $symposium_ninth_author_affiliation . "\" />\n<br />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_ninth_author_affiliation\" /><br />";
          }

          echo "</div>
                <br />
                <p>
                <br /><br />
                <p>
                <label>投稿摘要：（必填）</label>
                <p>全部共 <span id=\"txtCount\">0</span> 字，中文 <span id=\"chineseTextCount\">0</span> 字，英文 <span id=\"englishTextCount\">0</span> 字</p>";

          if (strcmp($symposium_abstract, '') != 0) {
            echo "<textarea name=\"symposium_abstract\" id=\"symposium_abstract\" rows=\"30\" cols=\"65\">" . $symposium_abstract . "</textarea>";
          }
          else {
            echo "<textarea name=\"symposium_abstract\" id=\"symposium_abstract\" rows=\"30\" cols=\"65\"></textarea>";
          }

          echo "</p>
                <p>
                <label>關鍵字：（必填）</label>";

          if (strcmp($symposium_keywords, '') != 0) {
            echo "<input type=\"text\" name=\"symposium_keywords\" value=\"" . $symposium_keywords . "\" size=\"75\" />";
          }
          else {
            echo "<input type=\"text\" name=\"symposium_keywords\" size=\"75\" />";
          }

          echo "<button name=\"symposium_word_count_button\" id=\"symposium_word_count_button\" style=\"margin-left: 10px;\">計算字數</button>";
          echo "</p>
                <br />
                <input type=\"submit\" name=\"next_abstract\" value=\"按此輸入下一篇論文\" />
                </fieldset>
                <br />
                <p>";

          echo "<input type=\"submit\" name=\"submit_total_abstract\" value=\"全部完成送出\" disabled=\"disabled\" />";
          echo "</p>
                <hr />
                <p>
                * 提醒您：投稿完成後，若您計畫前來參加研討會，仍需至報名系統完成報名手續，請詳實填寫各項參加資訊以供本大會提供相關服務。謝謝！
                </p>";
          }
        }
      ?>
      </form>
    </div>

    <div id="footer">
      <p>&copy; 2009 第四十八屆台灣心理學年會</p>
    </div>

  </div>
</body>
</html>